package com.ddwl.shop.dao.mapper;

import com.ddwl.common.dao.mapper.TkMapper;
import com.ddwl.schema.bo.shop.QueryShopUserRecordBo;
import com.ddwl.shop.dao.model.ShopBanner;
import com.ddwl.shop.dao.model.ShopUserRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

/**
 * (ShopUserRecord)数据库交互Mapper
 *
 * @author wenbin
 * @since 2020-06-02 14:48:12
 */
public interface ShopUserRecordMapper extends TkMapper<ShopUserRecord> {

    /**
     * 查询最近浏览店铺
     * @param userId
     * @return String
     */
    @Select("SELECT shop_id FROM sys_shop_user_record where user_id= #{userId, jdbcType=VARCHAR} ORDER BY gmt_created desc limit 1;")
    String queryRelateRecord(@Param("userId") String userId);

    /**
     * 查询访客数量
     * @param query
     * @return integer
     */
    Integer queryConsumeCount(@Param("query") QueryShopUserRecordBo query);
}